package com.member.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;

import com.member.mapper.CollegeMapper;
import com.member.po.Clazz;
import com.member.po.College;
import com.member.service.CollegeService;

public class CollegeServiceImpl implements CollegeService{
	@Autowired
	private CollegeMapper collegeMapper;

	public void setMap(Map map){
		if(map==null){
			return;
		}
		int pageNum = (int) map.get("pageNum");
		int size = (int) map.get("size");
		int startNum = (pageNum-1)*size;
		map.put("startNum", startNum);
	}
	
	@Override
	public int countRows(Map map){
		this.setMap(map);
		return collegeMapper.countRows(map);
	}
	
	@Override
	public List<College> select(Map map){
		this.setMap(map);
		return collegeMapper.select(map);
	}
	
	@Override
	public College selectById(int id) {
		return collegeMapper.selectById(id);
	}

	@Override
	public void insert(College clazz) {
		collegeMapper.insert(clazz);
	}

	@Override
	public void updateById(College clazz) {
		collegeMapper.updateById(clazz);
	}

	@Override
	public void deleteById(int id) {
		collegeMapper.deleteById(id);
	}


}